package com.uphone.magicleafteacher.pro.adapter;

import android.support.annotation.NonNull;
import android.view.View;

import com.blankj.utilcode.util.SizeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.uphone.magicleafteacher.R;
import com.uphone.magicleafteacher.util.CommonUtil;
import com.uphone.magicleafteacher.view.MyBaseViewHolder;

public class ImageAdapter extends BaseQuickAdapter<String, MyBaseViewHolder> {
    public ImageAdapter() {
        super(R.layout.item_image);
    }

    @Override
    protected void convert(@NonNull MyBaseViewHolder helper, String item) {
        helper.setImageViewCorner(mContext, R.id.iv_item, CommonUtil.getImageUrl(item), SizeUtils.dp2px(8))
                .setClick(R.id.iv_item, new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        CommonUtil.openBigPic(CommonUtil.getImageUrl(item));
                    }
                });
    }
}
